package com.amose.springcloudoauth2server.authentication.service.impl;

import com.amose.springcloudoauth2server.authentication.entity.UserInfo;
import com.amose.springcloudoauth2server.authentication.mapper.UserInfoMapper;
import com.amose.springcloudoauth2server.authentication.service.IUserInfoService;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author amose
 * @since 2021-07-01
 */
@Service
@Primary
public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo> implements IUserInfoService {

    @Override
    public UserInfo queryByUserName(String userName) {
        QueryWrapper<UserInfo> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("user_name",userName);
        return this.getOne(queryWrapper);
    }
}
